<?xml version="1.0" encoding="UTF-8"?>


<!--
	document.inc.xsl

	template per formattazione documento
-->


<xsl:stylesheet
	version = "1.0"
	xmlns = "http://www.w3.org/1999/xhtml"
	xmlns:inc = "http://ltw0807.web.cs.unibo.it/xsl/inc"
	xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">


	<!--
		Template inc:document

		Crea lo scheletro completo della pagina XHTML.
	-->
	<xsl:template name = "inc:document">
		<xsl:element name = "html">
			<xsl:call-template name = "inc:head"/>
			<xsl:call-template name = "inc:body"/>
		</xsl:element>
	</xsl:template>


	<!--
		Template inc:head

		Crea l'elemento <head> della pagina XHTML.
	-->
	<xsl:template name = "inc:head">
		<xsl:element name = "head">
			<xsl:element name = "title">
				<xsl:text>PoliWiki</xsl:text>
			</xsl:element>

			<!-- Link ai CSS: prima il layout... -->
			<xsl:call-template name = "inc:create-link-css">
				<xsl:with-param
					name = "css-url"
					select = "$layout-url"/>
			</xsl:call-template>

			<!-- ... poi la skin. -->
			<xsl:call-template name = "inc:create-link-css">
				<xsl:with-param
					name = "css-url"
					select = "$skin-url"/>
			</xsl:call-template>
		</xsl:element> <!-- /head -->
	</xsl:template>


	<!--
		Template inc:body

		Crea il <body> della pagina XHTML.
	-->
	<xsl:template name = "inc:body">
		<xsl:element name="body">
			<!--
				pagina
					header
					cornice
					info-pagina
			-->
			<xsl:element name="div">
				<xsl:attribute name="id">
					<xsl:text>pagina</xsl:text>
				</xsl:attribute>

				<!--
					header
						logo
						menubar
							navigazione
							opzioni
				-->
				<xsl:element name="div">
					<xsl:attribute name="id">
						<xsl:text>header</xsl:text>
					</xsl:attribute>

					<xsl:apply-templates select="//logo"/>

					<xsl:element name="div">
						<xsl:attribute name="id">
							<xsl:text>menubar</xsl:text>
						</xsl:attribute>

						<xsl:apply-templates select="//navigazione"/>
						<xsl:apply-templates select="//opzioni"/>
					</xsl:element> <!-- /menubar -->
				</xsl:element> <!-- /header -->

				<!--
					cornice
						messaggio
						errore
						scheda
						response
				-->
				<xsl:element name="div">
					<xsl:attribute name="id">
						<xsl:text>cornice</xsl:text>
					</xsl:attribute>

					<xsl:apply-templates select="//messaggio"/>
					<xsl:apply-templates select="//errore"/>
					<xsl:apply-templates select="//scheda"/>
					<xsl:apply-templates select="//response"/>
				</xsl:element>

				<xsl:apply-templates select="//info-pagina"/>
			</xsl:element>
		</xsl:element> <!-- /body -->
	</xsl:template>
</xsl:stylesheet>
